﻿using BCCommon;
using BCDto.Sim.Admin.AdminPermissionConfig;
using BCDto.Common.TreeNode;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.Sim.Admin.AdminPermissionConfig
{
    /// <summary>
    /// 员工权限配置
    /// </summary>
    public interface IAdminPermissionConfigService
    {
        /// <summary>
        /// 检查员工权限是否存在
        /// </summary>
        /// <param name="permissionCode">权限码</param>
        /// <returns></returns>
        bool CheckExists(string permissionCode);
        /// <summary>
        /// 添加员工权限
        /// </summary>
        /// <param name="requestDto">员工权限</param>
        /// <returns></returns>
        AdminPermissionConfigDto Add(AdminPermissionConfigRequestDto requestDto);
        /// <summary>
        /// 更新员工权限
        /// </summary>
        /// <param name="putDto">员工权限</param>
        /// <returns></returns>
        AdminPermissionConfigDto Update(AdminPermissionConfigPutDto putDto);
        /// <summary>
        /// 删除员工权限
        /// </summary>
        /// <param name="adminPermissionConfigId">员工权限Id</param>
        /// <returns></returns>
        void Delete(long adminPermissionConfigId);
        /// <summary>
        /// 获取员工权限列表
        /// </summary>
        /// <returns></returns>
        IEnumerable<AdminPermissionConfigDto> GetList();
        /// <summary>
        /// 获取未使用的员工权限列表
        /// </summary>
        /// <returns></returns>
        IEnumerable<TreeNodeDto<AdminPermissionConfigDto>> GetUnusedList();
        /// <summary>
        /// 获取员工权限列表（分页）
        /// </summary>
        /// <param name="permissionName">权限名称</param>
        /// <param name="permissionCode">权限码</param>
        /// <param name="permissionPathCode">权限路径码</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <param name="ascending"></param>
        /// <param name="sortName"></param>
        /// <returns></returns>
        PageableList<AdminPermissionConfigDto> Query(string permissionName, string permissionCode, string permissionPathCode,string sortName,bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 修复所有配置错误的权限配置信息
        /// </summary>
        void FixErrorPermissionConfigRecord();
    }
}
